package com.mapDemo.treeMap;

import java.util.TreeMap;

/**
 * @Author milian
 * @Date 2021/7/26 0026 20:49
 */
public class demo1 {
    public static void main(String[] args) {
        TreeMap<Student, String> treeMap = new TreeMap<>();
        Student s1 = new Student("李一", 13);
        Student s2 = new Student("李二", 12);
        Student s3 = new Student("李三", 11);
        treeMap.put(s1,"湖南");
        treeMap.put(s2,"天津");
        treeMap.put(s3,"北京");
        treeMap.forEach((Student key,String value)->{
            System.out.println(key+","+value);
        });
    }
}
